package com.class08;

import java.util.ArrayList;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/4/1 16:00
 */
public class Person {
    //
    String name;
    int age;

//    public Person() {
//
//        System.out.println("无参构造方法被调动到了");
//
//    }

    public Person(String n) {
        name = n;
    }

    public Person(String n, int a) {
        name = n;
        age = a;
    }

    public void eat() {
        System.out.println("吃饭");
    }

    public void sleep(int hours) {
        System.out.println("一天睡觉" + hours + "小时");
    }
}
